Public Class ModulosGrid

    Private Sub mnuAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAgregar.Click

        ModuloForm.accion = "Alta"

        ModuloForm.Show()
    End Sub


    Private Sub mnuEditar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEditar.Click
        ModuloForm.accion = "Modifica"
        ModuloForm.accion = DataGridView1.CurrentRow.Index

        LlenarForm1()

        ModuloForm.Show()
    End Sub

    Private Sub mnuEliminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEliminar.Click
        ModuloForm.accion = "Elimina"
        ModuloForm.accion = DataGridView1.CurrentRow.Index

        LlenarForm1()

        ModuloForm.Show()
    End Sub

    Private Sub mnuSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSalir.Click
        Me.Close()
    End Sub

    Private Sub LlenarForm1()
        ModuloForm.TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString
        ModuloForm.ComboBox1.SelectedItem = DataGridView1.CurrentRow.Cells(1).Value - 1
        ModuloForm.ComboBox2.SelectedItem = DataGridView1.CurrentRow.Cells(2).Value - 1
        ModuloForm.ComboBox3.SelectedItem = DataGridView1.CurrentRow.Cells(3).Value - 1

    End Sub

    Private Sub ModulosGrid_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        DataGridView1.DataSource = modulos_list
    End Sub
End Class